﻿@using NITASA.Areas.Admin.Helper.Sitemap;
@using NITASA.Areas.Admin.ViewModels;
@model Sitemap
@{
    ViewBag.Title = "Generate Sitemap";
}
@section PageLevelStyles {    
    <style>
        .table th, .table td {
            border:none;
        }
    </style>
}
<div class="main-content">
    <div class="container-fluid padded">
        @if (TempData["SuccessMessage"] != null)
        {
            <div class="alert alert-success">
                <button class="close" data-dismiss="alert" type="button">
                    ×
                </button>
                @TempData["SuccessMessage"]
            </div>
        }
        @if (TempData["ErrorMessage"] != null)
        {
            <div class="alert alert-error">
                <button class="close" data-dismiss="alert" type="button">
                    ×
                </button>
                @TempData["ErrorMessage"]
            </div>
        }
        @using (Html.BeginForm("Generate", "Sitemap", FormMethod.Post))
        {
            <div class="row-fluid">
                <div class="span12">
                    <div class="box">
                        <div class="box-header">
                            <span class="title">Site Map </span>
                        </div>
                        <div class="box-content padded">
                            <div class="row-fluid">
                                <div class="span12">
                                    <div class="box-content">
                                        <div class="padded">
                                            <table class="table table-condensed" style="width: 50%">
                                                <tr>
                                                    <td></td>
                                                    <td>
                                                        Change Frequency
                                                    </td>
                                                    <td>
                                                        Priority (between 0.1 to 1.0)
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        Posts
                                                    </td>
                                                    <td>
                                                        @Html.DropDownListFor(c => c.postFreqency, DropDownHelper.GetFrequencyDDL(string.Empty), "Select")<br />
                                                        <div style="color:red;">
                                                            @Html.ValidationMessageFor(c => c.postFreqency)
                                                        </div>
                                                    </td>
                                                    <td>
                                                        @Html.TextBoxFor(c => c.postPriority)<br />
                                                        <div style="color:red;">
                                                            @Html.ValidationMessageFor(c => c.postPriority)
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        Pages
                                                    </td>
                                                    <td>
                                                        @Html.DropDownListFor(c => c.postFreqency, DropDownHelper.GetFrequencyDDL(string.Empty), "Select")<br />
                                                        <div style="color:red;">
                                                            @Html.ValidationMessageFor(c => c.pageFreqency)
                                                        </div>
                                                    </td>
                                                    <td>
                                                        @Html.TextBoxFor(c => c.pagePriority)<br />
                                                        <div style="color:red;">
                                                            @Html.ValidationMessageFor(c => c.pagePriority)
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        Categories
                                                    </td>
                                                    <td>
                                                        @Html.DropDownListFor(c => c.postFreqency, DropDownHelper.GetFrequencyDDL(string.Empty), "Select")<br />
                                                        <div style="color:red;">
                                                            @Html.ValidationMessageFor(c => c.categoryFreqency)
                                                        </div>
                                                    </td>
                                                    <td>
                                                        @Html.TextBoxFor(c => c.categoryPriority)<br />
                                                        <div style="color:red;">
                                                            @Html.ValidationMessageFor(c => c.categoryPriority)
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        Tags
                                                    </td>
                                                    <td>
                                                        @Html.DropDownListFor(c => c.postFreqency, DropDownHelper.GetFrequencyDDL(string.Empty), "Select")<br />
                                                        <div style="color:red;">
                                                            @Html.ValidationMessageFor(c => c.labelFreqency)
                                                        </div>
                                                    </td>
                                                    <td>
                                                        @Html.TextBoxFor(c => c.labelPriority)<br />
                                                        <div style="color:red;">
                                                            @Html.ValidationMessageFor(c => c.labelPriority)
                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row-fluid">
                                <div class="control-group">
                                    <input type="submit" value="Generate Sitemap" class="btn btn-blue" />
                                    @if (ViewBag.Fileexists!=null)
                                    { 
                                        <a class="" style="height:100px;" href="@Url.Action("Download", "Sitemap")">
                                            <input type="button" value="Download" class="btn btn-blue" />
                                        </a>
                                    }
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        }
    </div>
</div>
